package com.weimei.conversionTreasure.viewModel;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.weimei.conversionTreasure.http.entity.SelKhBean;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.base.ItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

public class SelKhItemVM extends ItemViewModel {
    public ObservableField<SelKhBean.DataDTO.AppointsDTO> entity = new ObservableField<>();

    SelKhVM mSelKhVM;

    public SelKhItemVM(@NonNull BaseViewModel viewModel, SelKhBean.DataDTO.AppointsDTO data) {
        super(viewModel);
        mSelKhVM = (SelKhVM) viewModel;
        entity.set(data);
    }

    public BindingCommand itemClick = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            mSelKhVM.setBack(entity.get());
        }
    });
}
